<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=393, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>绑定信息</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            width: 100%;
            height: 100vh; /* 全屏高度 */
            display: flex;
            justify-content: center; /* 水平居中 */
            align-items: center; /* 垂直居中 */
            overflow: hidden;
        }

        .container {
            width: 393px;
            height: 853px;
            max-width: 100%;
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            padding: 20px;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px;
            background-color: #ddd;
            border-radius: 4px;
        }

        .header h2 {
            font-size: 16px;
            margin: 0;
            text-align: left;
            flex-grow: 1;
        }

        .back-button {
            text-decoration: none;
            color: #333;
            font-size: 14px;
            background-color: #ddd;
            padding: 5px 10px;
            border-radius: 4px;
        }

        .back-button:hover {
            background-color: #bbb;
        }

        .flash-message {
            margin-bottom: 15px;
            padding: 10px;
            border: 1px solid transparent;
            border-radius: 4px;
            text-align: center;
            color: #721c24;
            background-color: #f8d7da;
            border-color: #f5c6cb;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            color: #333;
        }

        .form-group input {
            width: 100%;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
        }

        .form-group select {
            width: 100%;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
            margin-bottom: 15px;
            height: 38px;
            font-size: 16px;
            background-color: white;
        }

        .submit-btn {
            width: 100%;
            padding: 10px;
            background-color: #28a745;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }

        .submit-btn:hover {
            background-color: #218838;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 顶部导航 -->
        <div class="header">
            <h2>绑定信息</h2>
            <a href="{{ url_for('my') }}" class="back-button">返回</a>
        </div>

        <!-- Flash 消息显示区域 -->
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    <div class="flash-message">{{ message }}</div>
                {% endfor %}
            {% endif %}
        {% endwith %}

        <!-- 绑定信息表单 -->
        <form method="POST" action="{{ url_for('bind_info') }}">
            <div class="form-group">
                <label for="name">姓名：</label>
                <input type="text" id="name" name="name" placeholder="请输入姓名" required>
            </div>
            <div class="form-group">
                <label for="idcard">身份证：</label>
                <input type="text" id="idcard" name="idcard" placeholder="请输入身份证" required>
            </div>
            <div class="form-group">
                <label for="ticket_type">票型：</label>
                <select id="type" name="type">
                    <option value="成人票">成人票</option>
                    <option value="儿童票">儿童票</option>
                    <option value="优待票">优待票</option>
                </select>
            </div>
            <button type="submit" class="submit-btn">确认</button>
        </form>
    </div>
</body>
</html>
